import type {RouteRecordRaw} from "vue-router";

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    component: () => import('@/components/layout/Layout.vue'),
    redirect: '/home',
    meta: {
      title: '/',
      hidden: false,
      icon: 'el-Star',
    },
    children: [
      // 首页
      {
        path: '/home',
        name: 'home',
        component: () => import("@/views/home/Home.vue"),
        meta: {
          title: '仪表盘',
          hidden: false,
          icon: 'el-DataLine',
        },
      },
      {
        path: '/statistics',
        name: 'statistics',
        component: () => import('@/views/statistics/index.vue'),
        meta: {
          title: '报表统计',
          hidden: false,
          icon: "el-Menu"
        }
      },
      {
        path: '/detail',
        name: 'detail',
        component: () => import('@/views/detail/index.vue'),
        meta: {
          title: '明细',
          hidden: false,
          icon: "el-DocumentCopy"
        },
      },
      {
        path: '/tag',
        name: 'tag',
        component: () => import('@/views/tags/index.vue'),
        meta: {
          title: '标签管理',
          hidden: false,
          icon: "el-CollectionTag"
        },
      }, {
        path: '/family',
        name: 'family',
        component: () => import('@/views/family/index.vue'),
        meta: {
          title: '家庭管理',
          hidden: false,
          icon: "el-OfficeBuilding"
        },
      },
      {
        path: '/personalCenter',
        name: 'personalCenter',
        meta: {
          title: '个人中心',
          hidden: false,
          icon: "el-User"
        },
        children: [
          {
            path: '/personalCenter/info',
            name: 'info',
            component: () => import("@/views/personal-center/Info.vue"),
            meta: {
              title: '用户信息',
              hidden: false,
              icon: "el-Document"
            },
          },
          {
            path: '/personalCenter/setting',
            name: 'setting',
            component: () => import("@/views/personal-center/Setting.vue"),
            meta: {
              title: '用户设置',
              hidden: false,
              icon: "el-Setting"
            },
          }
        ]
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/404/index.vue'),
    meta: {
      title: '404',
      hidden: true,
    },
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'any',
    redirect: '/404',
    meta: {
      title: 'any',
      hidden: true,
    },
  },
];
